/**
 * 
 */
package poc.android;

import poc.android.weather.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
 * Main page... depends on which button pressed... launch the different POC
 * apps (activities actually)
 * 
 * @author Jason
 *
 */
public class MainLauncherActivity extends Activity {

	public static final String INTENT_HOME="INTENT_HOME";
	public static final String INTENT_ACTION_REVIEW_APP_LAUNCH="INTENT_ACTION_REVIEW_APP_LAUNCH";
	public static final String INTENT_ACTION_JSON_APP_LAUNCH="INTENT_ACTION_JSON_APP_LAUNCH";
	public static final String INTENT_ACTION_LINUX_APP_LAUNCH="INTENT_ACTION_LINUX_APP_LAUNCH";
	public static final String INTENT_ACTION_EXP_EXPACTIVITY_APP_LAUNCH="INTENT_ACTION_EXP_EXPACTIVITY_APP_LAUNCH";
	public static final String INTENT_ACTION_NO_MORE_EXP_APP_LAUNCH="INTENT_ACTION_NO_MORE_EXP_APP_LAUNCH";
	
	Button btnReview;
	Button btnJSon;
	Button btnLinux;
	Button btnExpxxActivity;
	Button btnExpActivity;
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.main);
		
		this.setupWidgets(savedInstanceState);
	}
	
	/**
	 * method to handle/setup the widgets
	 * @param pBundle
	 */
	private void setupWidgets(Bundle pBundle) {
		this.btnReview=(Button) this.findViewById(R.id.btnMainReviewApp);
		this.btnReview.setOnClickListener(new Button.OnClickListener() {
			//@Override
			public void onClick(View v) {
				Intent aIntent=new Intent(INTENT_ACTION_REVIEW_APP_LAUNCH);
				startActivity(aIntent);
				finish();
			}
		});
		this.btnJSon=(Button) this.findViewById(R.id.btnMainJSonApp);
		this.btnJSon.setOnClickListener(new Button.OnClickListener() {
			//@Override
			public void onClick(View v) {
				Intent aIntent=new Intent(INTENT_ACTION_JSON_APP_LAUNCH);
				startActivity(aIntent);
				// if not... u can still back to this page after a few "escape"
				finish();
			}
		});
		this.btnLinux=(Button) this.findViewById(R.id.btnMainLinuxApp);
		this.btnLinux.setOnClickListener(new Button.OnClickListener() {
			//@Override
			public void onClick(View v) {
				Intent aIntent=new Intent(INTENT_ACTION_LINUX_APP_LAUNCH);
				startActivity(aIntent);
				// if not... u can still back to this page after a few "escape"
				finish();
			}
		});
		this.btnExpxxActivity=(Button) this.findViewById(R.id.btnMainExpxxActivityApp);
		this.btnExpxxActivity.setOnClickListener(new Button.OnClickListener(){
			
			public void onClick(View arg0) {
				Intent aIntent=new Intent(INTENT_ACTION_EXP_EXPACTIVITY_APP_LAUNCH);
				startActivity(aIntent);
				// if not... u can still back to this page after a few "escape"
				finish();
			}}
		);
		this.btnExpActivity=(Button) this.findViewById(R.id.btnMainExpActivityApp);
		this.btnExpActivity.setOnClickListener(new Button.OnClickListener(){
			
			public void onClick(View arg0) {
				Intent aIntent=new Intent(INTENT_ACTION_NO_MORE_EXP_APP_LAUNCH);
				startActivity(aIntent);
				// if not... u can still back to this page after a few "escape"
				finish();
			}}
		);
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onResume() {
		super.onResume();
	}
	
}
